package job.job_0818;

import java.util.Scanner;
import java.util.Random;
public class GuessNumbers {//完成猜数字游戏 ，用户输入数字，判断该数字是大于，小于，还是等于随机生成的数字，等于的时候退出程序。
    public static void main(String[] args) {
        Random r = new Random();
        int ra = r.nextInt(100);
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int num = sc.nextInt();
            if (num > ra)
                System.out.println("猜大了！");
            else if (num < ra)
                System.out.println("猜小了！");
            else {
                System.out.println("猜对了！");
                break;
            }
        }
    }
}
